var express = require('express');
var router = express.Router();
var multer= require('multer');
var fs=require('fs');
var upload=multer({dest:'uploads/'});
/* GET users listing. */
router.post('/', upload.any(),function(req, res, next) {
    var file = req.files;
    console.log('文件类型：%s', file[0].mimetype);
    console.log('原始文件名：%s', file[0].originalname);
    console.log('文件大小：%s', file[0].size);
    console.log('文件保存路径：%s', file[0].path);
  
    var readStream= fs.createReadStream(file[0].path);
    var writeStream=fs.createWriteStream('D://'+file[0].originalname);
    readStream.pipe(writeStream);
    global.sendExchangemy2.sendMessage({time: Date.now(),myb:'你好啊'});
    res.send('respond with a resource');
});

module.exports = router;
